home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************
- * *
- * Copyright (c) 1991 Silicon Graphics, Inc. *
- * All Rights Reserved *
- * *
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
- * *
- * The copyright notice above does not evidence any actual of intended *
- * publication of such source code, and is an unpublished work by Silicon *
- * Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
- * the property of Silicon Graphics, Inc. Any use, duplication or *
- * disclosure not specifically authorized by Silicon Graphics is strictly *
- * prohibited. *
- * *
- * RESTRICTED RIGHTS LEGEND: *
- * *
- * Use, duplication or disclosure by the Government is subject to *
- * restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
- * Technical Data and Computer Software clause at DFARS 52.227-7013, *
- * and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
- * Supplement. Unpublished - rights reserved under the Copyright Laws of *
- * the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
- * Shoreline Blvd., Mountain View, CA 94039-7311 *
- **************************************************************************
- *
- * File: spoolers.c
- *
- * Description: Prints which spooling system is the default and the
- * available spooling systems.
- *
- **************************************************************************/
-
-
- #ident "$Revision: 1.1 $"
-
-
- #include <stdio.h>
- #include <stdlib.h>
- #include "spool.h"
-
-
- main()
- {
- unsigned int def, spoolers;
-
- /*
- * Obtain default spooler and available spooling systems
- */
- if (SLGetSpooler(&def, &spoolers) < 0) {
- SLPerror("spooler");
- exit(1);
- }
-
- /*
- * Print the name of the default spooler
- */
- (void)printf("Default spooler: ");
- switch (def) {
- case SL_SPOOLER_NONE:
- (void)printf("None\n");
- break;
- case SL_SPOOLER_BSD:
- (void)printf("BSD\n");
- break;
- case SL_SPOOLER_SYSV:
- (void)printf("Sys V\n");
- break;
- }
-
- /*
- * Print a list of available spooling systems
- */
- (void)printf("Available spoolers: ");
- if (spoolers == SL_SPOOLER_NONE)
- (void)printf("None");
- if (spoolers & SL_SPOOLER_BSD)
- (void)printf("BSD ");
- if (spoolers & SL_SPOOLER_SYSV)
- (void)printf("Sys V ");
- (void)printf("\n");
-
- /*
- * As a test try to set BSD spooler as default
- */
- (void)printf("\nTrying to explictly select BSD spooler...\n");
- if (SLSetSpooler(SL_SPOOLER_BSD) < 0)
- (void)printf("Spooler was not available and was not set\n");
- else
- (void)printf("Spooler available and set\n");
- if (SLGetSpooler(&def, &spoolers) < 0) {
- SLPerror("spooler");
- exit(1);
- }
- (void)printf("\nNew Default spooler: ");
- switch (def) {
- case SL_SPOOLER_NONE:
- (void)printf("None\n");
- break;
- case SL_SPOOLER_BSD:
- (void)printf("BSD\n");
- break;
- case SL_SPOOLER_SYSV:
- (void)printf("Sys V\n");
- break;
- }
-
- return 0;
- }
-